{% if formField %}
    {% if disableSubmit != 1 %}
        <div class="card">
        <form method="POST" action="{{ url }}" class="form-horizontal ajaxform needs-validation" accept-charset="UTF-8" novalidate>
            <div class="card-body">
    {% endif %}
            {% for k,v in formField %}
                            {% if v['type'] == 'notice' %}
                      <div class="alert alert-warning" role="alert"><span class="mdi mdi-information"></span> {{ v['defaultValue'] }}</div>
                                {% endif %}
                <div class="form-group">
                    {% if v['type'] != 'hidden' and v['type'] != 'notice' %}
                    <label for="title" class="{% if v['attributes']['data-required'] is defined and v['attributes']['data-required'] %} require {% endif %}">{{ k }} :</label>
                    {% endif %}

                    {% if v['type'] == 'text' %}
                         <div class="input-group">
                                <div class="input-group-prepend">
                                    <span class="input-group-text"><i class="mdi mdi-pencil"></i></span>
                                </div>
                                <input type="text"
                                {% if v['attributes'] %}
                                    {% for ok,ov in v['attributes'] %}
                                        {{ ok }}="{{ ov }}"
                                    {% endfor %}
                                {% endif %}

                                {% if v['attributes']['data-required'] is defined and v['attributes']['data-required'] %} required {% endif %}

                                       value="{{ v['defaultValue'] }}"
                                       class="form-control form-control-sm"
                                >
                         </div>
                    {% endif %}

                    {% if v['type'] == 'string' %}
                    <div>{{ v['defaultValue'] }}</div>
                    {% endif %}

                    {% if v['type'] == 'daterange' %}
                            <div class="input-group">
                                <div class="input-group-prepend">
                                  <span class="input-group-text">
                                    <i class="mdi mdi-calendar-range"></i>
                                  </span>
                                </div>
                                <input type="text"
                                {% if v['attributes'] %}
                                    {% for ok,ov in v['attributes'] %}
                                            {{ ok }}="{{ ov }}"
                                    {% endfor %}
                                {% endif %}
                                  {% if v['attributes']['data-required'] is defined and v['attributes']['data-required'] %} required {% endif %}
                                value="{{ if_get(v['defaultValue'], '') }}"
                                class="form-control form-control-sm daterange"
                                placeholder="输入 ..."
                                >
                            </div>
                    {% endif %}

                     {% if v['type'] == 'datetime' %}
                            <div class="input-group">
                                <div class="input-group-prepend">
                                    <span class="input-group-text"><i class="mdi mdi-clock"></i></span>
                                </div>
                                <input type="text"

                                {% if v['attributes'] %}
                                    {% for ok,ov in v['attributes'] %}
                                        {{ ok }}="{{ ov }}"
                                    {% endfor %}
                                {% endif %}
  {% if v['attributes']['data-required'] is defined and v['attributes']['data-required'] %} required {% endif %}
                                value="{{ if_get(v['defaultValue'], '') }}"
                                class="form-control form-control-sm datetime"
                                placeholder="输入 ...">
                            </div>
                    {% endif %}

                    {% if v['type'] == 'date' %}
                            <div class="input-group">
                                <div class="input-group-prepend">
                                    <span class="input-group-text"><i class="mdi mdi-clock"></i></span>
                                </div>
                                <input type="text"
                                {% if v['attributes'] %}
                                    {% for ok,ov in v['attributes'] %}
                                        {{ ok }}="{{ ov }}"
                                    {% endfor %}
                                {% endif %}
  {% if v['attributes']['data-required'] is defined and v['attributes']['data-required'] %} required {% endif %}
                                value="{{ if_get(v['defaultValue'], '') }}"
                                class="form-control form-control-sm date"
                                placeholder="输入 ...">
                            </div>
                    {% endif %}

                    {% if v['type'] == 'datetimerange' %}
                            <div class="input-group">
                                <div class="input-group-prepend">
                                    <span class="input-group-text"><i class="mdi mdi-clock"></i></span>
                                </div>
                                <input type="text"

                                {% if v['attributes'] %}
                                    {% for ok,ov in v['attributes'] %}
                                            {{ ok }}="{{ ov }}"
                                    {% endfor %}
                                {% endif %}
  {% if v['attributes']['data-required'] is defined and v['attributes']['data-required'] %} required {% endif %}
                                 value="{{ if_get(v['defaultValue'], '') }}"
                                class="form-control form-control-sm datetimerange"
                                placeholder="输入 ...">
                            </div>
                    {% endif %}

                    {% if v['type'] == 'file' %}
                            <div class="input-group">
                                <input type="hidden" name="{{ v['field'] }}"  value="{{ v['defaultValue'] }}"  {% if v['attributes']['data-required'] is defined and v['attributes']['data-required'] %} data-required="1" {% endif %} >
                                <input type="file" data-field="{{ v['field'] }}"
                                       {% if v['attributes'] %}
                                            {% for ok,ov in v['attributes'] %}
                                                {% if ok != "name" and ok != "id" and ok != "data-required" %}
                                                    {{ ok }}="{{ ov }}"
                                                {% endif %}
                                            {% endfor %}
                                        {% endif %}
                                          {% if v['attributes']['data-required'] is defined and v['attributes']['data-required'] %} required {% endif %}
                                        multiple
                                       class="form-control form-control-sm ufile"
                                />
                <div class="invalid-feedback">
                  请先上传
                </div>
                            </div>
                    {% endif %}

                    {% if v['type'] == 'password' %}
                            <div class="input-group">
                                <div class="input-group-prepend">
                                    <span class="input-group-text"><i class="mdi mdi-key"></i></span>
                                </div>
                                <input type="password"

                                        {% if v['attributes'] %}
                                            {% for ok,ov in v['attributes'] %}
                                                {{ ok }}="{{ ov }}"
                                            {% endfor %}
                                        {% endif %}
  {% if v['attributes']['data-required'] is defined and v['attributes']['data-required'] %} required {% endif %}
                                       class="form-control form-control-sm"
                                />
                            </div>
                    {% endif %}

                    {% if v['type'] == 'textarea' %}
                            <div class="input-group">
                                <textarea
                                {% if v['attributes'] %}
                                    {% for ok,ov in v['attributes'] %}
                                        {{ ok }}="{{ ov }}"
                                    {% endfor %}
                                {% endif %}
                                class="form-control form-control-sm"
  {% if v['attributes']['data-required'] is defined and v['attributes']['data-required'] %} required {% endif %}
                                >{{ v['defaultValue'] }}</textarea>
                            </div>
                    {% endif %}

                    {% if v['type'] == 'boole' %}
                        <div class="input-group">
                        <input type="checkbox"
                            {% if v['attributes'] %}
                                {% for ok,ov in v['attributes'] %}
                                    {{ ok }}="{{ ov }}"
                                {% endfor %}
                            {% endif %}

                            {% if v['defaultValue'] %} checked {% endif %}
                            data-bootstrap-switch
                        >
                        </div>
                  {% endif %}

                    {% if v['type'] == 'select' %}
                        <div class="input-group">
                            <input type="hidden" name="formHidden-{{ v['field'] }}" value="{{ v['defaultValue'] }}"  />
                            <select
                                    {% if v['attributes'] %}
                                        {% for ok,ov in v['attributes'] %}
                                                {% if ok=='placeholder' %}
                                                    data-placeholder="{{ ov }}"
                                                {% else %}
                                                    {{ ok }}="{{ ov }}"
                                                {% endif %}
                                        {% endfor %}
                                    {% endif %}
  {% if v['attributes']['data-required'] is defined and v['attributes']['data-required'] %} required {% endif %}
                                    class="form-control form-control-sm select"
                                    style="width: 100%;"

                                     >
                                {% set selectV = get_prop(v['options'],"") %}
                                {% if selectV %}
                                    {% for k,v in selectV %}
                                        <option value="{{ v }}">{{ k|raw }}</option>
                                    {% endfor %}
                                {% endif %}
                            </select>
                        </div>
                    {% endif %}

                    {% if v['type'] == 'multiSelect' %}
                            <div class="input-group" >
                                <input type="hidden" name="formHidden-{{ v['field'] }}" value="{{ v['defaultValue']|json_encode }}"  />
                                <select

                                {% if v['attributes'] %}
                                    {% for ok,ov in v['attributes'] %}
                                        {% if ok=='placeholder' %}
                                            data-placeholder="{{ ov }}"
                                        {% else %}
                                            {{ ok }}="{{ ov }}"
                                        {% endif %}
                                    {% endfor %}
                                {% endif %}
  {% if v['attributes']['data-required'] is defined and v['attributes']['data-required'] %} required {% endif %}
                                        class="form-control form-control-sm select"
                                        multiple="multiple"
                                        style="width: 100%;"
                                >
                                    {% set selectV = get_prop(v['options'],"") %}
                                    {% if selectV %}
                                        {% for k,v in selectV %}
                                            <option value="{{ v }}">{{ k|raw }}</option>
                                        {% endfor %}
                                    {% endif %}
                                </select>
                            </div>
                    {% endif %}

                    {% if v['type'] == "search_select" %}
                                <div class="input-group" >
                                   <input type="hidden" name="formHidden-{{ v['field'] }}" value="{{ v['defaultValue'] }}"  />
                                    {% set selectV = get_prop(v['options'],"") %}
                                    <select

                                    {% if v['attributes'] %}
                                        {% for ok,ov in v['attributes'] %}
                                            {{ ok }}="{{ ov }}"
                                        {% endfor %}
                                    {% endif %}
  {% if v['attributes']['data-required'] is defined and v['attributes']['data-required'] %} required {% endif %}
                                    class="form-control form-control-sm search_select"
                                    data-url="{{ selectV[0] }}"
                                    style="width: 100%;"

                                    >
                                    {% if selectV[1] %}
                                        {% for k,v in selectV[1] %}
                                            <option value="{{ v }}">{{ k|raw }}</option>
                                        {% endfor %}
                                    {% endif %}
                                    </select>
                                </div>
                    {% endif %}

                    {% if v['type'] == "search_multiple_select" %}
                            <div class="input-group" >
                                <input type="hidden" name="formHidden-{{ v['field'] }}" value="{{ v['defaultValue']|json_encode }}"  />
                                {% set selectV = get_prop(v['options'],"") %}
                                <select

                                {% if v['attributes'] %}
                                    {% for ok,ov in v['attributes'] %}
                                        {{ ok }}="{{ ov }}"
                                    {% endfor %}
                                {% endif %}
  {% if v['attributes']['data-required'] is defined and v['attributes']['data-required'] %} required {% endif %}
                                class="form-control form-control-sm search_select"
                                multiple="multiple"
                                data-url="{{ selectV[0] }}"
                                style="width: 100%;"

                                >
                                {% if selectV[1] %}
                                    {% for k,v in selectV[1] %}
                                        <option value="{{ v }}">{{ k|raw }}</option>
                                    {% endfor %}
                                {% endif %}
                                </select>
                            </div>
                    {% endif %}

                    {% if v['type'] == 'hidden' %}
                        <input type="hidden"

                        {% if v['attributes'] %}
                        {% for ok,ov in v['attributes'] %}
                            {{ ok }}="{{ ov }}"
                        {% endfor %}
                        {% endif %}

                        value="{{ v['defaultValue'] }}"  />
                    {% endif %}

                    {% if v['type'] == 'rich_editor' %}
                            <div class="input-group" >
                <textarea  class="form-control form-control-sm rich_text"
                {% if v['attributes'] %}
                    {% for ok,ov in v['attributes'] %}
                        {{ ok }}="{{ ov }}"
                    {% endfor %}
                {% endif %}
                />{{ v['defaultValue']}}</textarea>
                            </div>
                    {% endif %}

                </div>
            {% endfor %}
        {% if disableSubmit != 1 %}
            </div>
                <div class="card-footer">
                    <div class="col-md-2"></div>
                    <div class="col-md-8">
                        <div class="btn-group">
                            <button type="submit" class="btn btn-sm btn-info " style="margin-right: 10px;"><i class="mdi mdi-arrow-up"></i> 提交</button>
                            <button type="reset" class="btn btn-default btn-sm reset"><i class="mdi mdi-undo"></i> 重置</button>
                        </div>
                    </div>
                </div>
        </form>
            </div>
    {% endif %}
{% endif %}
